//
//  LoginHeadView.m
//  SafeFoodManagerDemo
//
//  Created by bob on 2017/10/9.
//  Copyright © 2017年 bob. All rights reserved.
//

#import "LoginHeadView.h"

#define icoScaleWidth [UIScreen mainScreen].bounds.size.width<375?80:100
@interface  LoginHeadView ( )

@property(nonatomic,strong)UIImageView *IcoImageView;

@property(nonatomic,strong)UILabel *TipLabel;

@end

@implementation LoginHeadView

-(instancetype)initWithFrame:(CGRect)frame
{
    if (self=[super initWithFrame:frame]) {
   
        self.backgroundColor=TBColorAppTheme;
        
        CGFloat w=icoScaleWidth;
        
        
        self.IcoImageView=[[UIImageView alloc]initWithFrame:CGRectMake(self.centerX-w/2.0, self.centerY-w/2.0-35*SCREEN_WIDTH/414.0, icoScaleWidth, icoScaleWidth)];
        
        self.IcoImageView.image=[UIImage imageNamed:@"login"];
        
        [self addSubview:self.IcoImageView];
        
        self.TipLabel=[[UILabel alloc]initWithFrame:CGRectMake(0, self.IcoImageView.bottom+20*SCREEN_WIDTH/320.0, SCREEN_WIDTH-60, 21)];
        
        self.TipLabel.textColor=[UIColor whiteColor];
        
        self.TipLabel.font=[UIFont boldSystemFontOfSize:24];
        
        self.TipLabel.text=@"食安检";
        
        self.TipLabel.textAlignment=NSTextAlignmentCenter;
        
        [self addSubview:self.TipLabel];

    }
    
    return self;
}

-(void)UpMoveAnation
{
    
    CGFloat newW=icoScaleWidth;

    self.IcoImageView.frame=CGRectMake(self.centerX-newW*0.8/2.0, self.centerY-newW/2.0-35*SCREEN_WIDTH/414.0-newW*0.2, newW*0.8, newW*0.8);
    self.TipLabel.frame=CGRectMake(0, self.IcoImageView.bottom+20*SCREEN_WIDTH/320.0, SCREEN_WIDTH-60, 21);
    
    self.TipLabel.font=[UIFont boldSystemFontOfSize:18];
}

-(void)DownMoveAnation
{
    CGFloat newW=icoScaleWidth;
    
     self.IcoImageView.frame=CGRectMake(self.centerX-newW/2.0, self.centerY-newW/2.0-35*SCREEN_WIDTH/414.0, icoScaleWidth, icoScaleWidth);
    
    self.TipLabel.frame=CGRectMake(0, self.IcoImageView.bottom+20*SCREEN_WIDTH/320.0, SCREEN_WIDTH-60, 21);
    
    self.TipLabel.font=[UIFont boldSystemFontOfSize:24];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
